package com.ccut.xunfeiSpringboot.service.impl;/*
 * ClassName: QuestionServiceImpl
 * Package: com.ccut.xunfeiSpringboot.service.impl
 * Description:
 * @Author 刘千湫
 * @Create 2025/7/12 10:18
 * @Version 1.0
 */
import com.ccut.xunfeiSpringboot.entity.Question;
import com.ccut.xunfeiSpringboot.mapper.QuestionMapper;
import com.ccut.xunfeiSpringboot.service.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class QuestionServiceImpl implements QuestionService {

    @Autowired
    private QuestionMapper questionMapper;

    @Override
    public List<Question> getAllQuestions() {
        return questionMapper.getAllQuestions();
    }

    @Override
    public Question getQuestionById(Integer id) {
        return questionMapper.getQuestionById(id);
    }

    @Override
    public void addQuestion(Question question) {
        questionMapper.addQuestion(question);
    }

    @Override
    public void updateQuestion(Question question) {
        questionMapper.updateQuestion(question);
    }
    @Override
    public List<Question> getQuestionsByPage(Integer pageNum, Integer pageSize) {
        return questionMapper.getQuestionsByPage(pageNum, pageSize);
    }
    @Override
    public void deleteQuestion(Integer id) {
        questionMapper.deleteQuestion(id);
    }
}
